package com.oe.market.modules.base.controller;

import com.google.gson.Gson;
import com.oe.market.modules.base.model.bean.ServerInfo;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping(value = "/sys")
public class SystemController {

    @RequestMapping(value = "/info")
    @ResponseBody
    public String info() {
        Gson gson = new Gson();
        Map<String,Object> map = new HashMap<>();
        map.put("version", ServerInfo.version);
        map.put("start_time", ServerInfo.createTime);
        return gson.toJson(map);
    }
}
